/**
*****************************************************************************
*
* Copyright (C) 2018 LAN-YOU(GuangZhou). All rights reserved
*
* @par Project: 
*      TCU
*
* @par Module:
*      IPC Event
*
* @par Usage Notes:
*      It is a communication middleware for application to set up one to one 
*      or one to many communication channel.
*
* @par Author:
*      Nick Huang
*
*****************************************************************************
*/

#include "ipc_event.h"
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include "elog.h"


// default listening port
static const unsigned short DEFAULT_IPC_EVT_PORT = 10006u;

using namespace ipc_event;

int main(int argc , char ** argv)
{
  elog_init();

  // initializ ipc event service
  if (!IPCPeerManager::instance()->initialize(DEFAULT_IPC_EVT_PORT)) //创建服务器socket
  {
    return -1;
  }

  printf("IPCPeerManager start to runEventloop!\n");
  // run the default service port for the service
  IPCPeerManager::instance()->runEventLoop();

   printf("IPCPeerManager start to finalize!\n");
  // finalize the ipc event service
  (void)IPCPeerManager::instance()->finalize();
  
  return 0;
}


